using UnityEngine;
using System.Collections;

public class movePlayer : MonoBehaviour
{
    public float velChar = -10;

    void Start()
    {
        transform.position = new Vector3(0, 1, 0);
    }

    void FixedUpdate()
    {
		  if (!Input.anyKeyDown)
		{
			rigidbody.velocity = Vector3.zero;
		}

        if (Input.GetKey(KeyCode.S))
        {
            transform.Translate(0, 0, -velChar * Time.deltaTime);
            //rigidbody.AddForce(0,0,-velChar);

        }
        if (Input.GetKey(KeyCode.W))
        {
            transform.Translate(0, 0, velChar * Time.deltaTime);

        }
        if (Input.GetKey(KeyCode.D))
        {
            transform.Translate(velChar * Time.deltaTime, 0, 0);

        }
        if (Input.GetKey(KeyCode.A))
        {
            transform.Translate(-velChar * Time.deltaTime, 0, 0);

        }
    }
}

